package com.zhongjian.technologycal.mall.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.squareup.picasso.Picasso;
import com.zhongjian.technologycal.mall.R;
import com.zhongjian.technologycal.mall.activity.main.bean.TeacherBean;
import com.zhongjian.technologycal.mall.base.BaseContacts;

import java.util.List;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by wei on 2018/4/8.
 */

public class CourseTeacherAdapter extends BaseQuickAdapter<TeacherBean,BaseViewHolder> {

    public CourseTeacherAdapter(List data) {
        super(R.layout.items_teacher_list, data);
    }

    @Override
    protected void convert(final BaseViewHolder helper, final TeacherBean item) {
        if (item == null){
            return;
        }
        int layoutPosition = helper.getLayoutPosition();
        helper.setText(R.id.teacher_tv_title,item.getName());
        helper.setText(R.id.teacher_tv_desc,item.getSynopsis());
        Picasso.get().load(BaseContacts.BASE_URL + item.getHeadpic())
                .into((CircleImageView) helper.getView(R.id.teacher_iv_heading));

    }

}
